#include "State.h"
#include "StateContext.h"
void StateFour::execute(){}
void StateFour::execute(StateContext* sc1, Player &player){
	//move a piece to create the highest possible stack
	int pieceToMove = makesHighestStack(player);
	GameData()->board.MovePiece(pieceToMove, pieceToMove+GameData()->board.GetSizeOfStack(pieceToMove));

	//change states
	if (exitable(player)/* we can exit a piece*/){
		sc1->curState = new StateOne;
	}
	else if (trampolinable(player)){
		//can make another trampoline
		sc1->curState = new StateTwo;
	}
	else if (!(allPiecesCovered(player)) && !(singular(player))/*can make a stack of 2+*/){
		if (canSetupTrampoline(player)/*can make a stack within trampoline range*/){
			sc1->curState = new StateThree;
		}
		else{
			sc1->curState = new StateFour;
		}
	}
	else if (singular(player)){
		sc1->curState = new StateFive;
	}
	else if (allPiecesCovered(player)/*no valid moves*/){
		sc1->curState = new StateSix;
	}
	else{
		sc1->curState = new StateSeven;
	}
}